home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12480 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: airdmhor.gen.nz!not-for-mail
  2. From: gumboot@airdmhor.gen.nz (Simon Hosie)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: "Best fit" algorithm (help)
  5. Date: 1 Apr 1996 17:40:13 +1200
  6. Organization: Airdmhor : a couple of BBS's, a bunch of people, and a cat.
  7. Message-ID: <4jnq7t$643@airdmhor.gen.nz>
  8. References: <APC&7'0'22b6b83'874@peg.apc.org> <4jhlu7$5m2@airdmhor.gen.nz> <4ji4b1$jc5@news1.mnsinc.com>
  9. NNTP-Posting-Host: airdmhor.gen.nz
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. riox@peg.apc.org:
  13. > I am looking for a "best fit" algorithm. 
  14. > The problem I have is very similar to finding the best way of fitting the 
  15. > maximum number of songs on (say) 45 minute tape.
  16.  
  17. Simon Hosie (gumboot@airdmhor.gen.nz) wrote:
  18. >   I used to have a program like that for my C64, the guy that wrote it said
  19. > the most effective method he found was trying random combinations.
  20.  
  21. Szu-Wen Huang:
  22. > The solution to the knapsack problem is to randomly allocate?!  I'm
  23. > fairly sure my algorithm teacher doesn't know this yet.  Care to show
  24. > some numbers?  *Chuckle*
  25.  
  26.   He said it was faster than brute force.  I couldn't be bothered writing my
  27. own so I just accepted it.  It's got me curious, now, I think I might have a
  28. go at it.
  29.